package filedemo;

import java.io.File;
import java.io.IOException;

public class CreateFileDemo {
    public static void main(String[] args) throws IOException {
        File file=new File("C:\\Users\\DELL\\IdeaProjects\\jsd2502\\test.txt");
        if(file.exists()){
            System.out.println("文件已经存在");
        }else{
                file.createNewFile();
                System.out.println("文件创建成功");
            }
    }
}
